<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: ArRatioInputJoydrive Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArRatioInputJoydrive.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classArRatioInputJoydrive-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArRatioInputJoydrive Class Reference<div class="ingroups"><a class="el" href="group__OptionalClasses.html">Optional Classes</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Use computer joystick to control an <a class="el" href="classArActionRatioInput.html" title="Action that requests motion based on abstract ratios provided by diferent input sources. ">ArActionRatioInput</a> and drive the robot.  
 <a href="classArRatioInputJoydrive.html#details">More...</a></p>

<p><code>#include &lt;ArRatioInputJoydrive.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0eba970616c6e0882bf8fe3524a8e042"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#a0eba970616c6e0882bf8fe3524a8e042">ArRatioInputJoydrive</a> (<a class="el" href="classArRobot.html">ArRobot</a> *robot, <a class="el" href="classArActionRatioInput.html">ArActionRatioInput</a> *input, int priority=50, bool stopIfNoButtonPressed=false, bool useOSCalForJoystick=true)</td></tr>
<tr class="memdesc:a0eba970616c6e0882bf8fe3524a8e042"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a0eba970616c6e0882bf8fe3524a8e042">More...</a><br /></td></tr>
<tr class="separator:a0eba970616c6e0882bf8fe3524a8e042"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e8547bcaa09bb9d29491d554fd04fef"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e8547bcaa09bb9d29491d554fd04fef"></a>
<a class="el" href="classArJoyHandler.html">ArJoyHandler</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#a6e8547bcaa09bb9d29491d554fd04fef">getJoyHandler</a> (void)</td></tr>
<tr class="memdesc:a6e8547bcaa09bb9d29491d554fd04fef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the joyHandler. <br /></td></tr>
<tr class="separator:a6e8547bcaa09bb9d29491d554fd04fef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e7543222fc19f6e16ad4702dfdaa33e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4e7543222fc19f6e16ad4702dfdaa33e"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#a4e7543222fc19f6e16ad4702dfdaa33e">getStopIfNoButtonPressed</a> (void)</td></tr>
<tr class="memdesc:a4e7543222fc19f6e16ad4702dfdaa33e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get if we'll stop if no button is pressed, otherwise just do nothing. <br /></td></tr>
<tr class="separator:a4e7543222fc19f6e16ad4702dfdaa33e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af717f859e19cff6158e95f6f24f8995c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#af717f859e19cff6158e95f6f24f8995c">getUseOSCal</a> (void)</td></tr>
<tr class="memdesc:af717f859e19cff6158e95f6f24f8995c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets whether OSCalibration is being used for the joystick or not.  <a href="#af717f859e19cff6158e95f6f24f8995c">More...</a><br /></td></tr>
<tr class="separator:af717f859e19cff6158e95f6f24f8995c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add0e352b358b2f6e7e28de6b6afe3272"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add0e352b358b2f6e7e28de6b6afe3272"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#add0e352b358b2f6e7e28de6b6afe3272">joystickInited</a> (void)</td></tr>
<tr class="memdesc:add0e352b358b2f6e7e28de6b6afe3272"><td class="mdescLeft">&#160;</td><td class="mdescRight">Whether the joystick is initalized or not. <br /></td></tr>
<tr class="separator:add0e352b358b2f6e7e28de6b6afe3272"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca20d4084cea78973c480662bbc22e95"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aca20d4084cea78973c480662bbc22e95"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#aca20d4084cea78973c480662bbc22e95">setStopIfNoButtonPressed</a> (bool stopIfNoButtonPressed)</td></tr>
<tr class="memdesc:aca20d4084cea78973c480662bbc22e95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set if we'll stop if no button is pressed, otherwise just do nothing. <br /></td></tr>
<tr class="separator:aca20d4084cea78973c480662bbc22e95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80b26abcf86e8f4e6fe62c84bdc484aa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#a80b26abcf86e8f4e6fe62c84bdc484aa">setUseOSCal</a> (bool useOSCal)</td></tr>
<tr class="memdesc:a80b26abcf86e8f4e6fe62c84bdc484aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets whether to use OSCalibration the joystick or not.  <a href="#a80b26abcf86e8f4e6fe62c84bdc484aa">More...</a><br /></td></tr>
<tr class="separator:a80b26abcf86e8f4e6fe62c84bdc484aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c0c4117b7e6b4e7d948070756e357f8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c0c4117b7e6b4e7d948070756e357f8"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArRatioInputJoydrive.html#a1c0c4117b7e6b4e7d948070756e357f8">~ArRatioInputJoydrive</a> ()</td></tr>
<tr class="memdesc:a1c0c4117b7e6b4e7d948070756e357f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a1c0c4117b7e6b4e7d948070756e357f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aac3e5e4ad0d9d637552a269a99101d95"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aac3e5e4ad0d9d637552a269a99101d95"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>fireCallback</b> (void)</td></tr>
<tr class="separator:aac3e5e4ad0d9d637552a269a99101d95"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:aa75453f2bec857f8bc9acc8f4e4b1115"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa75453f2bec857f8bc9acc8f4e4b1115"></a>
<a class="el" href="classArFunctorC.html">ArFunctorC</a>&lt; <a class="el" href="classArRatioInputJoydrive.html">ArRatioInputJoydrive</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>myFireCB</b></td></tr>
<tr class="separator:aa75453f2bec857f8bc9acc8f4e4b1115"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7baf9681876ea98567029d39e6340b30"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7baf9681876ea98567029d39e6340b30"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myFiredLast</b></td></tr>
<tr class="separator:a7baf9681876ea98567029d39e6340b30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af40f6478dbede35b17c9c37b4af49aea"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af40f6478dbede35b17c9c37b4af49aea"></a>
<a class="el" href="classArActionRatioInput.html">ArActionRatioInput</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>myInput</b></td></tr>
<tr class="separator:af40f6478dbede35b17c9c37b4af49aea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01d71f69f888551122c0c2f315115365"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01d71f69f888551122c0c2f315115365"></a>
<a class="el" href="classArJoyHandler.html">ArJoyHandler</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>myJoyHandler</b></td></tr>
<tr class="separator:a01d71f69f888551122c0c2f315115365"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac168a7b7a812075cee4a6723e10dfbcf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac168a7b7a812075cee4a6723e10dfbcf"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myPreviousUseOSCal</b></td></tr>
<tr class="separator:ac168a7b7a812075cee4a6723e10dfbcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6bd326403c52f15952c30fd2d827743d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6bd326403c52f15952c30fd2d827743d"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myPrinting</b></td></tr>
<tr class="separator:a6bd326403c52f15952c30fd2d827743d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a892da9058394fca0526ca7dc22d4597b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a892da9058394fca0526ca7dc22d4597b"></a>
<a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>myRobot</b></td></tr>
<tr class="separator:a892da9058394fca0526ca7dc22d4597b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0adf82c50ad1970a122b2dd6375459d1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0adf82c50ad1970a122b2dd6375459d1"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myStopIfNoButtonPressed</b></td></tr>
<tr class="separator:a0adf82c50ad1970a122b2dd6375459d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c1573f73e6ce5b6153da29e1f6c9f98"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6c1573f73e6ce5b6153da29e1f6c9f98"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myUseOSCal</b></td></tr>
<tr class="separator:a6c1573f73e6ce5b6153da29e1f6c9f98"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Use computer joystick to control an <a class="el" href="classArActionRatioInput.html" title="Action that requests motion based on abstract ratios provided by diferent input sources. ">ArActionRatioInput</a> and drive the robot. </p>
<p>This class obtains data from a joystick attached to the computer and provides it to an <a class="el" href="classArActionRatioInput.html" title="Action that requests motion based on abstract ratios provided by diferent input sources. ">ArActionRatioInput</a> which drives the robot. (See <a class="el" href="classArRatioInputRobotJoydrive.html" title="Use robot&#39;s joystick to control an ArActionRatioInput action and drive the robot. ...">ArRatioInputRobotJoydrive</a> for a similar class that uses the robot's built in joystick interface.) A callback is attached to the <a class="el" href="classArActionRatioInput.html" title="Action that requests motion based on abstract ratios provided by diferent input sources. ">ArActionRatioInput</a> object which reads joystick information and sets requested drive rations on the <a class="el" href="classArActionRatioInput.html" title="Action that requests motion based on abstract ratios provided by diferent input sources. ">ArActionRatioInput</a></p>
<p>If the joystick button is pressed, then input values are set in the ArActionRatioDrive action object to request motion. If the button is not pressed, then either the robot will be stopped via the action (if <em>stopIfNoButtonPressed</em> is true), or no action will be requested and lower priority actions can take over (if <em>stopIfNoButtonPressed</em> is false)</p>
<p>You may need to calibrate the joystick for it to work right, for details about this see <a class="el" href="classArJoyHandler.html" title="Interfaces to a computer joystick. ">ArJoyHandler</a>.</p>
<p>This class creates its own <a class="el" href="classArJoyHandler.html" title="Interfaces to a computer joystick. ">ArJoyHandler</a> object to get input from the joystick, or uses the global <a class="el" href="classArJoyHandler.html" title="Interfaces to a computer joystick. ">ArJoyHandler</a> object in the global <a class="el" href="classAria.html" title="Contains global initialization, deinitialization and other global functions. ">Aria</a> class if present. Then it will scale the speed between 0 and the given max for velocity and turning, up and down on the joystick go forwards/backwards while right and left go right and left.</p>
<p>NOTE: The joystick does not save calibration information, so you may need to calibrate the joystick before each time you use it. To do this, press the button for at least a half a second while the joystick is in the middle. Then let go of the button and hold the joystick in the upper left for at least a half second and then in the lower right corner for at least a half second. See also <a class="el" href="classArJoyHandler.html" title="Interfaces to a computer joystick. ">ArJoyHandler</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classArRatioInputRobotJoydrive.html" title="Use robot&#39;s joystick to control an ArActionRatioInput action and drive the robot. ...">ArRatioInputRobotJoydrive</a> </dd>
<dd>
<a class="el" href="classArActionRatioInput.html" title="Action that requests motion based on abstract ratios provided by diferent input sources. ">ArActionRatioInput</a> </dd>
<dd>
<a class="el" href="classArJoyHandler.html" title="Interfaces to a computer joystick. ">ArJoyHandler</a> </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a0eba970616c6e0882bf8fe3524a8e042"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ArRatioInputJoydrive::ArRatioInputJoydrive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td>
          <td class="paramname"><em>robot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArActionRatioInput.html">ArActionRatioInput</a> *&#160;</td>
          <td class="paramname"><em>input</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>priority</em> = <code>50</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>stopIfNoButtonPressed</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>useOSCalForJoystick</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">robot</td><td>robot </td></tr>
    <tr><td class="paramname">input</td><td>Action to attach to and use to drive the robot. </td></tr>
    <tr><td class="paramname">priority</td><td>Priority of this joystick input handler with respect to other input objects attached to the <em>input</em> action object. </td></tr>
    <tr><td class="paramname">stopIfNoButtonPressed</td><td>if this is true and there is a joystick and no button is pressed, we cause the action to stop the robot. .. otherwise it'll do nothing (letting lower priority actions fire)</td></tr>
    <tr><td class="paramname">useOSCalForJoystick</td><td>if this is true we'll use the OS calibration, if false we'll do our own. See also <a class="el" href="classArJoyHandler.html#a8300efa2a57cebcc590fe360d3264f5d" title="Sets whether to just use OS calibration or not. ">ArJoyHandler::setUseOSCal()</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af717f859e19cff6158e95f6f24f8995c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArRatioInputJoydrive::getUseOSCal </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets whether OSCalibration is being used for the joystick or not. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classArJoyHandler.html#a8057d05613ec0acf0ed8279c2d91f883" title="Gets whether to just use OS calibration or not. ">ArJoyHandler::getUseOSCal</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a80b26abcf86e8f4e6fe62c84bdc484aa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ArRatioInputJoydrive::setUseOSCal </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>useOSCal</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets whether to use OSCalibration the joystick or not. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classArJoyHandler.html#a8300efa2a57cebcc590fe360d3264f5d" title="Sets whether to just use OS calibration or not. ">ArJoyHandler::setUseOSCal</a> </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>ArRatioInputJoydrive.h</li>
<li>ArRatioInputJoydrive.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArRatioInputJoydrive.html">ArRatioInputJoydrive</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
